package com.Questions.BinarySearch;


/**
 * 猜数字大小
 */
public class leetcode374 {
    int guess(int num){
        return -1;
    }
    public int guessNumber(int n) {
        int low=1;
        int heigh=n;
        while (heigh>=low){
            int mid=low+(heigh-low)/2;
            if(guess(mid)==1){
                low=mid+1;
            }else if(guess(mid)==-1){
                heigh=mid-1;
            }else{
                return mid;
            }
        }
        return -1;
    }

}
